package com.heu.blood.match.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.heu.blood.match.converter.DictConverter;
import lombok.Builder;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * 
 * @author lyj
 * @email lyj@heu.com
 * @date 2023-06-16 00:23:13
 */
@Data
@TableName("blood_information")
public class BloodInformationEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 编号
	 */
	@ExcelIgnore
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 血液ID
	 */
	@ExcelProperty(value="blood_id", converter = DictConverter.class)
	private String bloodId;

	/**
	 * 创建时间
	 */
	@ExcelIgnore
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@TableField(value = "gmt_create", fill = FieldFill.INSERT) // 创建注解
	private Date gmtCreate;

	/**
	 * 修改时间
	 */
	@ExcelIgnore
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	@TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE) // 更新注解
	private Date gmtModified;

	/**
	 * 血装编号条码
	 */
	@ExcelProperty(value="barcode")
	private String barcode;
	/**
	 * 扩展码-产品码
	 */
	@ExcelProperty(value="extend_code", converter = DictConverter.class)
	private String extendCode;
	/**
	 * 血液品名-字典
	 */
	@ExcelProperty(value="blood_type", converter = DictConverter.class)
	private String bloodType;
	/**
	 * 规格/血量-数字
	 */
	@ExcelProperty(value="blood_count")
	private BigDecimal bloodCount;
	/**
	 * ABO血型
	 */
	@ExcelProperty(value="abo_blood_type", converter = DictConverter.class)
	private String aboBloodType;
	/**
	 * RH血型
	 */
	@ExcelProperty(value = "rh_blood_type", converter = DictConverter.class)
	private String rhBloodType;

	/**
	 * 失效时间
	 */
	@ExcelProperty(value = "failure_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	private Date failureTime;

	/**
	 * 采血时间
	 */
	@ExcelProperty(value = "collect_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	private Date collectTime;

	/**
	 * 血液来源-字典-供血机构
	 */
	@ExcelProperty(value="blood_source", converter = DictConverter.class)
	private String bloodSource;

	/**
	 * 状态-字典
	 */
	@ExcelIgnore
	private String bloodState;
	/**
	 * 入库金额
	 *
	 */
	@ExcelProperty(value = "inbound_price")
	private BigDecimal inboundPrice;
	/**
	 * 血袋位置-库存位置描述
	 */
	@ExcelProperty(value = "blood_location", converter = DictConverter.class)
	private String bloodLocation;
	/**
	 * 血液金额
	 */
	@ExcelProperty(value = "blood_price")
	private BigDecimal bloodPrice;
	/**
	 * 计量单位-ml等
	 */
	@ExcelProperty(value = "measurement_unit", converter = DictConverter.class)
	private String measurementUnit;
	/**
	 * 批次号
	 */
	@ExcelProperty(value = "batch_number")
	private Long batchNumber;
	/**
	 * 献血时编号
	 */
	@ExcelProperty(value = "blood_donation_code")
	private String bloodDonationCode;
	/**
	 * 血库出库编号
	 */
	@ExcelProperty(value = "blood_bank_delivery_id")
	private String bloodBankDeliveryId;
	/**
	 * 院区
	 */
	@ExcelProperty(value = "hospital_classification", converter = DictConverter.class)
	private String hospitalClassification;
	/**
	 * 0代表未核验，1代表核验成功，2代表核验失败
	 */
	@ExcelProperty(value = "test_flag")
	private Integer testFlag;
	/**
	 * 1代表展示，0代表不展示
	 */
	@ExcelIgnore
	@TableField(value = "if_show", fill = FieldFill.INSERT) // 创建注解
	private Integer ifShow;
	/**
	 *  1代表已删除，0代表未删除
	 */
	@ExcelIgnore
	@TableLogic(value = "0", delval = "1")
	@TableField(value = "is_deleted", fill = FieldFill.INSERT) // 创建注解
	private Integer isDeleted;

	/**
	 * 配血日期
	 */
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
	private Date matchTime;

	/**
	 * 血液大类
	 */
	@ExcelProperty(value = "component_category")
	private String componentCategory;

	/**
	 * 血液大类
	 */
	@ExcelProperty(value = "blood_type_code")
	private String bloodTypeCode;

	/**
	 * 血站出库编号
	 */
	@ExcelProperty(value = "blood_center_delivery_id")
	private String bloodCenterDeliveryId;

	/**
	 * 血站出库编号
	 */
	@ExcelProperty(value = "number")
	private String number;

	/**
	 * 血型抗筛
	 */
	@ExcelProperty(value = "antibody_screening")
	private String antibodyScreening;


	/**
	 * 入库日期
	 */
	@ExcelProperty(value = "in_storge_time")
	private String 	inStorgeTime;
}
